package com.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.common.valid.ListValue;
import com.common.valid.groups.AddGroupsInterface;
import com.common.valid.groups.UpdateGroupsInterface;
import lombok.Data;
import lombok.val;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * Ʒ��
 *
 * @author yjv
 * @email 111111@163.com
 * @date 2024-08-04 00:42:44
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * Ʒ��id
     */
    @TableId
    @NotNull(message = "更新品牌ID必须不为空",groups = {UpdateGroupsInterface.class})
    @Null(message = "添加的品牌ID必须为空",groups = {AddGroupsInterface.class})
    private Long brandId;
    /**
     * Ʒ����
     */
            @NotBlank(message = "品牌名称不能为空",groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
    private String name;
    /**
     * Ʒ��logo��ַ
     */
    @URL(message = "logo必须是一个合法地址",groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
    @NotBlank(message = "logo不能为空",groups = {AddGroupsInterface.class})
    @Null(groups = {UpdateGroupsInterface.class})
    private String logo;
    /**
     * ����
     */
    private String descript;
    /**
     * ��ʾ״̬[0-����ʾ��1-��ʾ]
     */
    @ListValue(val={1,0},groups = {AddGroupsInterface.class, UpdateGroupsInterface.class})
    @NotNull(message = "显示状态不能为空",groups = AddGroupsInterface.class)
    private Integer showStatus;
    /**
     * ��������ĸ
     */
    @NotBlank(message = "检索首字母不能为空",groups = AddGroupsInterface.class)
    @Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是单个字母",groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
    private String firstLetter;
    /**
     * ����
     */
    @Min(value = 0,message = "排序不能小于0",groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
    @NotNull(message = "排序不能为空",groups = AddGroupsInterface.class)
    private Integer sort;

}
